<?php
    require dirname(__FILE__).'/../class/member.class.php';
    $memberObj=new member;
    if($_POST["memID"]==""){
        if($memberObj->availableUsername($_POST["user"])){
            echo "available";
        }else{
            echo "notAvailable";
        }
    }else{
        if($memberObj->availableUsername($_POST["user"],$_POST["memID"])){
            echo "available";
        }else{
            echo "notAvailable";
        }
    }